from pyecharts import options as opts
from pyecharts.charts import Geo, Page
from pyecharts.globals import ChartType, SymbolType,CurrentConfig
CurrentConfig.ONLINE_HOST="https://assets.pyecharts.org/assets/"

districts = ['南宁市', '柳州市', '桂林市', '梧州市', '北海市', '防城港市', '钦州市', '贵港市', '玉林市', '百色市', '贺州市', '河池市', '来宾市', '崇左市']
areas = [2.21, 1.86, 2.78, 1.25, 3.33, 6.17, 1.08, 1.06, 1.28, 3.62, 1.18, 3.35, 1.34, 1.74]

c = (
     Geo()
        .add_schema(maptype= "广西")
        .add("geo1", [list(z) for z in zip(districts[:7], areas[:7])])
        .add("geo2", [list(z) for z in zip(districts[7:], areas[7:])])

        .set_series_opts(label_opts=opts.LabelOpts(is_show=False))
        .set_global_opts(
            visualmap_opts=opts.VisualMapOpts(is_piecewise=True, max_=max(areas), min_ = min(areas)),
            title_opts=opts.TitleOpts(title="Geo-广西地图" ),
        )
    )
c.render()